<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Class 类名</title>
</head>
<body>
<div class="box">盒子1</div>
<div class="box">盒子2</div>
<div id="nav">
  <ul>
    <li>首页</li>
    <li>产品</li>
  </ul>
</div>
<script>
  //getElementsByClassName根据类名获得某些元素集合
  const boxes = document.getElementsByClassName("box")
  console.log(boxes)
</script>
</body>

</html>
